package com.breakfast.fun.ui.user.cart;

import com.breakfast.fun.data.entity.home.cart.SendTime;
import com.breakfast.fun.data.entity.home.product.ProductState;
import com.breakfast.fun.data.entity.user.coupon.Coupon;
import com.breakfast.fun.data.entity.user.recharge.RechargeMoney;
import com.breakfast.fun.data.entity.user.submit.OrderInfo;
import com.breakfast.fun.util.Api;
import com.breakfast.fun.util.RxSchedulers;

import java.util.Map;

import retrofit2.http.FieldMap;
import rx.Observable;

/**
 * Created by Administrator on 2016/9/8.
 */
public class UserCartModel implements UserCartContract.Model {
    @Override
    public Observable<SendTime> getSendTimeModel(@FieldMap Map<String, String> map) {
        return Api.getInstance().service
                .getSendTimeModel(map)
                .compose(RxSchedulers.io_main());
    }

    @Override
    public Observable<ProductState> getProductStateModel(@FieldMap Map<String, String> map) {
        return Api.getInstance().service
                .getProductStateModel(map)
                .compose(RxSchedulers.io_main());
    }

    @Override
    public Observable<OrderInfo> getSubmitOrderModel(@FieldMap Map<String, String> map) {
        return Api.getInstance().service
                .getSubmitOrderModel(map)
                .compose(RxSchedulers.io_main());
    }

    @Override
    public Observable<RechargeMoney> getPayBeanModel(@FieldMap Map<String, String> map) {
        return Api.getInstance().service
                .getPayBeanModel(map).compose(RxSchedulers.io_main());
    }

    @Override
    public Observable<Coupon> getProperCouponModel(@FieldMap Map<String, String> map) {
        return Api.getInstance().service
                .getCouponModel(map)
                .compose(RxSchedulers.io_main());
    }

}
